window.onload = function () {


	const apiData = [
		{ "times": 4000, "price": 1200, "unitPrice": "0.3000" },
		{ "times": 8000, "price": 2000, "unitPrice": "0.2500" },
		{ "times": 40000, "price": 8000, "unitPrice": "0.2000" },
	];


	apiData.forEach(function (v) {
		$(".numtab").innerHTML += `
		<li data-price=${v.price} data-unitprice=${v.unitPrice}> ${v.times}次</li>
`;
	});

	$(".numtab li")[1].classList.add("active")
	$(".shm").innerHTML = `<p>
	<span> ¥ ${$(".numtab li")[1].dataset.price}</span>(约
	<span>   ${$(".numtab li")[1].dataset.unitprice}</span> 元/次),仅限企业实名购买;
</p>`
	/**
	 * 激活样式
	 */
	$(".qrcode li").forEach(function (v) {
		v.addEventListener("click", function () {
			if (!this.classList.contains("defauit")) {
				$(".qrcode li").forEach(function (item) {
					item.classList.remove("active")
				})
				this.classList.add("active");
				$(".shm").innerHTML = `<p>
				<span> &yen; ${this.dataset.price}</span>(约
				<span>${this.dataset.unitprice}</span> 元/次),仅限企业实名购买;
			</p>`;
			}
		})
	})
	// // apitab切换
	// // apitab切换
	function add(classname,classLs,on,active){
		// apitab切换
		classname.forEach(function (v, i) {
			classLs[i].classList.add(on)
			v.addEventListener("click", function () {
				classname.forEach(function (item, index) {
					item.classList.remove(active);
					classLs[index].classList.remove(on)
	
				});
				this.classList.add(active)
				classLs[i].classList.add(on)
				// 分类区
	
			})
		})
	}
	add($(".head li"),$(".simpletable"),"on","active")
}




//配置
const config = {
	selector: "#lzxg",
	vx: 4, //点x轴速度,正为右，负为左
	vy: 4, //点y轴速度
	height: 2, //点高宽，其实为正方形，所以不宜太大
	width: 2,
	count: 100, //点个数
	color: "#000", //点颜色
	stroke: "0,0,0", //线条颜色
	dist: 6000, //点吸附距离
	e_dist: 20000, //鼠标吸附加速距离
	max_conn: 10, //点到点最大连接数
};
//调用
CanvasParticle(config);

